package com.atguigu.day05;

public class Example6 {
    public static void main(String[] args) {
        var e = new POJO();
        var w = new Watermark();

        process(e);
        process(w);
    }

    public static void process(StreamRecord record) {
        if (record instanceof Watermark) {
            System.out.println("水位线");
        } else if (record instanceof POJO) {
            System.out.println("普通数据");
        }
    }

    public static abstract class StreamRecord {}

    public static class POJO extends StreamRecord {}

    public static class Watermark extends StreamRecord {}
}
